<script>
{literal}
function calcBMI() {
  var inches = document.getElementById('inches').value;
  var feet = document.getElementById('feet').value;
  var lb = document.getElementById('lb').value;
  if (!isNaN(inches) && !isNaN(feet) && !isNaN(lb)) {
        var totalInches = (feet*12)+parseInt(inches);
        var calcedBmi = Math.round((lb*702) /(totalInches*totalInches));
        var bmi = document.getElementById('bmi');
        bmi.value = calcedBmi;
  }
}
{/literal}
</script>
<form action='{$base_uri}index.php/WidgetForm/Fillout/{$formId}' id="ajaxForm{$formId}" method="post">
{if $open}
<input type="button" onClick="calcBMI();formSubmit({$formId});" value="Update" />
{/if}
<input type="hidden" name="form_id" value="{$formId}" />
<input type="hidden" name="process" value="true" />
<input type="hidden" name="filloutType" value="encounter" />
<table style="margin-left:50px;">
	<tr><td>Temp F:</td><td>Temp C:</td><td>Pulse:</td><td>Resp:</td><td>BP Sys:</td><td>BP Dias:</td></tr>
	<tr>
<td>{input type="string" name="objective_temp_f" size="4"}</td>
<td>{input type="string" name="objective_temp_c" size="4"}&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>{input type="string" name="objective_pulse" size="4"}</td>
<td>{input type="string" name="objective_resp" size="4"}</td>
<td>{input type="string" name="objective_bp_sys" size="4"}</td>
<td>{input type="string" name="objective_bp_dias" size="4"}</tr>

<tr><td>Height Ft:</td><td>Height In:</td><td>Weight Lb:</td><td>Waist In:</td><td>Hips In:</td><td>BMI</td><td>Glucose</td></tr>
	<tr>
<td>{input type="string" name="objective_height_ft" id="feet" size="4"}</td>
<td>{input type="string" name="objective_height_in" id="inches" size="4"}</td>
<td>{input type="string" name="objective_weight_lb" id="lb" size="4"}</td>
<td>{input type="string" name="objective_waist_in" size="4"}</td>
<td>{input type="string" name="objective_hips_in" size="4"}</td>
<td>{input type="string" name="objective_bmi" id="bmi" size="4"}</td>
<td>{input type="string" name="objective_glucose" size="4"}</td></tr>

	<tr>
	<td>Comments:</td>	<td colspan="10" valign="top">
			{input type="text" name="objective_comments"  rows="2" cols="70"}

		</td>
	</tr>
</tbody></table>
</form>
